#ifndef __MY_MQTT_H_
#define __MY_MQTT_H_

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <pthread.h>
#include <MQTTClient.h>
#include <cjson/cJSON.h>

#define ADDRESS     "8.146.206.1:1883"
#define CLIENTID    "edge_calc_client"
#define PAYLOAD     "12.56"
#define QOS         0
#define TIMEOUT     500L
#define USERNAME    "edge_calc_user"
#define PASSWORD    "123456" 

#define TOPIC_DATA_DEVICEID "data_deviceid"
#define TOPIC_CMD_DEVICEID "cmd_deviceid"
#define TOPIC_DATA_WAVE "data_wave2"
#define TOPIC_CMD_WAVE "cmd_wave"

//mqtt客户端初始化函数
int my_mqtt_init();
//订阅消息处理线程
void* my_mqtt_sub_thread(void* args);// in my_mqtt_client.c
//消息发布线程
void* my_mqtt_pub_thread(void* args);// in my_mqtt_client.c
//发布主题
void publish_data_deviceid();
//发布主题
void publish_data_wave(char* jsonStr);


#endif